<template>
	<view>
		<view class="noticeDetails-box" v-for="(item,index) in detailList" :key="index">
			<view class="title">
				{{item.title}}
			</view>
			<view class="info">
				<view class="info-left mr-20">
					<text>{{item.createTime}}</text>
				</view>
				<view class="info-right">
					<u-icon name="eye" size="30" label-color="#999" :label="item.readNum" :margin-left="15" />
				</view>
			</view>
			<view>
				<p class="paragraph">
					<text v-html="(item.content)"></text>
				</p>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		latestNewsDetail
	} from '@/api/base/latestNewsApi.js'
	export default {
		
		data() {
			return {
				detailList: [],
			};
		},
		mounted() {
		    this.loadData()
		  },
		methods: {
			 async loadData(record) {
			      try {
					  const params = {
					          id : this.$route.query.id
					        }
			        const response = await latestNewsDetail(params)
			
			        // 将返回的数据存储在detailList中
			        this.detailList = [response]  
					console.log(this.detailList,'this.detailList')
			      } catch (error) {
			        console.error('error', error)
			      }
				}
		}
	}
</script>

<style lang="scss" scoped>
	.noticeDetails-box {
		padding: 30rpx;
		background-color: $-color-white;
		height: 100vh;

		.title {
			font-weight: 700;
			font-size: 34rpx;
			margin-bottom: 30rpx;
		}

		.info {
			display: flex;
			align-items: center;
			color: #999;

			/deep/.u-icon {
				vertical-align: middle;

			}
		}
		
		.paragraph{
			margin-top: 20rpx;
			letter-spacing: 5rpx;
			line-height: 50rpx;
			text-indent: 1em;
		}
	}
	/deep/img{
			max-width: 100%;
			height: auto;
			display: block; 
			margin: 0 auto; 
		}
</style>